package test5.lupeng.jf.com.teamdemo.activitys;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import test5.lupeng.jf.com.teamdemo.R;

public class SettingActivity extends AppCompatActivity {

    @BindView(R.id.bt_quit)
    Button btQuit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);

    }

    @OnClick(R.id.bt_quit)
    public void onViewClicked() {
        Intent intent=new Intent(this,LoginActivity.class);
        startActivity(intent);
        SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
        SharedPreferences.Editor editor=sp.edit();
        editor.remove("objectId");
        editor.apply();
        SharedPreferences sp1 = getSharedPreferences("LoginStatus", MODE_PRIVATE);
        SharedPreferences.Editor editor1=sp1.edit();
        editor1.remove("isLogin");
        editor1.apply();
        finish();
    }
}
